package com.muyu.product.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.muyu.product.domain.base.CategoryBase;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import lombok.experimental.SuperBuilder;
import io.swagger.annotations.*;
import com.muyu.common.core.annotation.Excel;
import com.muyu.common.core.web.domain.BaseEntity;

/**
 * 品类品牌中间对象 as_category_brand
 *
 * @author DongZeLiang
 * @date 2024-02-27
 */
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@TableName("as_category_brand")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "AsCategoryBrand", description = "品类品牌中间")
public class AsCategoryBrand extends BaseEntity implements CategoryBase {

    private static final long serialVersionUID = 1L;

    /** 主键 */
    @TableId(value = "id",type = IdType.AUTO)
    @ApiModelProperty(name = "主键", value = "主键")
    private Long id;

    /** 品类id */
    @Excel(name = "品类id")
    @ApiModelProperty(name = "品类id", value = "品类id", required = true)
    private Long categoryId;

    /** 品牌id */
    @Excel(name = "品牌id")
    @ApiModelProperty(name = "品牌id", value = "品牌id", required = true)
    private Long brandId;

    public static AsCategoryBrand categoryBuild(Long categoryInfoId, Long brandId) {
        return AsCategoryBrand.builder()
                .brandId(brandId)
                .categoryId(categoryInfoId)
                .build();
    }

    @Override
    public Long getBaseId () {
        return this.brandId;
    }
}
